package com.example.wm.SanWar.controller;

import com.example.wm.common.Result;
import com.example.wm.common.ResultData;
import com.example.wm.SanWar.entity.AlliesRecodSheet;
import com.example.wm.SanWar.service.AlliesRecodeSheetService;
import com.example.wm.utils.TsyUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Slf4j
@RestController
@RequestMapping("/AlliesRecodSheetController")
public class AlliesRecodSheetController {
    @Resource
    private AlliesRecodeSheetService alliesRecodeSheetService;
    @Resource
    private TsyUtils tsyUtils;
    @Transactional
    @PostMapping("/Insert")
    public Result Insert(@RequestBody AlliesRecodSheet alliesRecodSheet) {
        alliesRecodSheet.setCreatetime(tsyUtils.getnowtime());
        boolean b=   alliesRecodeSheetService.save(alliesRecodSheet);

            return ResultData.success(b);


    }
}
